home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / pcboard / prfl200.zip / CONVERT.PPE (.txt) < prev    next >
PCBoard Programming Language Executable  |  1994-06-16  |  8KB  |  360 lines

  1. ;------------------------------------------------------------------------------
  2. ;                                                   .ss.
  3. ;                                                   `²²'
  4. ;             .,sS$Ss,,s$  .,sS$$$Ss.  .,sS$Ss,,s$ .ss.  .sSs.
  5. ;           .d$$²^°²$$$$'.d$P²°^^²$P'.d$$²^°²$$$$'.$$$' .$$$²Sb,.
  6. ;           $$$'   .$$$' $$$²Sçsµ²' .$$$'   .$$$'.$$$' .$$$'  `$$b.
  7. ;           $$$b,,d$$$' ,$$$b,....,s$$$$b,,d$$$'.$$$;.,$$$'    ;$$$
  8. ;           `²S$$S²²S$$S²°²S$$$$S²°°²S$$$$$$',$$S²°²S$S'.sS$$$P²'
  9. ;                                    .sS²°$$$²²°"'       d²°'
  10. ;                                  .$$²  .$$'
  11. ;                                  $$$.,d$$'
  12. ;                                  `²S$$S²'
  13. ;------------------------------------------------------------------------------
  14. ; P.P.L.X. 2.OO                          (C)1996 - Lone Runner / AEGiS CoRP'96 
  15. ;------------------------------------------------------------------------------
  16. ; PPE 2.OO (plain) - Analysis ON - Postprocessing ON
  17. ;------------------------------------------------------------------------------
  18.  
  19.     Integer  INTEGER001
  20.     Integer  INTEGER002
  21.     Integer  INTEGER003
  22.     String   STRING001
  23.     String   STRING002
  24.     String   STRING003
  25.     String   STRING004
  26.     String   STRING005
  27.     String   STRING006
  28.     String   STRING007
  29.     String   STRING008
  30.     String   STRING009
  31.     String   STRING010
  32.     String   STRING011
  33.     String   STRING012
  34.     String   STRING013
  35.     String   STRING014
  36.     String   STRING015
  37.     String   STRING016
  38.     String   STRING017
  39.     String   STRING018
  40.     String   STRING019
  41.     String   STRING020
  42.     String   STRING021
  43.     String   STRING022
  44.     String   STRING023
  45.     String   STRING024
  46.     String   STRING025
  47.     String   STRING026
  48.     String   STRING027
  49.     BigStr   BIGSTR001
  50.  
  51. ;------------------------------------------------------------------------------
  52.  
  53.     STRING024 = ""
  54.     INTEGER002 = ""
  55.     If (Exist(PPEPath() + "PROFILE.CFG")) Then
  56.         FOpen 1, PPEPath() + "PROFILE.CFG", 0, 0
  57.         FGet 1, STRING024
  58.         FGet 1, STRING025
  59.         FGet 1, STRING026
  60.         FClose 1
  61.         If (Ferr(1)) Then
  62.             PrintLn "Error opening Configuration File. Inform SysOp Immediately!"
  63.         Endif
  64.     Else
  65.         PrintLn "Configuration file does not exist. This program will not run without"
  66.         PrintLn "the 'PROFILE.CFG' file in the same directory as the 'PROFILE.PPE'."
  67.         End
  68.     Endif
  69.     For INTEGER003 = 1 To 50
  70.         STRING027 = Mid(STRING024, INTEGER003, 1)
  71.         INTEGER001 = Asc(STRING027)
  72.         INTEGER002 = INTEGER002 + INTEGER001
  73.     Next
  74.     If ((INTEGER002 * Len(Strip(STRING024, " "))) * 9 == STRING025) Then
  75.         Goto LABEL001
  76.     Else
  77.         Goto LABEL008
  78.     Endif
  79.     :LABEL001
  80.     Newline
  81.     PrintLn "@X0DP@X0Arofile @X0DC@X0Aonversion @X0DPPE @X0E1@X0A.@X0E0 @X0C(@X0Ec@X0C) @X0DTSCN@X0Aet @X0DS@X0Aoftware @X0DD@X0Aesigns @X0D1994@X0A."
  82.     Newline
  83.     PrintLn "@X0BExample@X0A:  @X0EY:\PCB\PPE  @X0B<-- NO TRAILING BACKSLASH"
  84.     InputStr "Path to Version 1.X Index files", STRING022, 15, 25, Mask_Ascii(), 128 + 64
  85.     If (STRING022 == "") Then
  86.         End
  87.     Endif
  88.     Newline
  89.     PrintLn "@X0DP@X0Alease @X0DH@X0Aold@X0D...."
  90.     Print "@X0DC@X0Aonverting @X0BIndex--@X0C" + STRING023
  91.     If (Exist(STRING022 + "\INDEX-A")) Then
  92.         STRING023 = "A"
  93.         Gosub LABEL002
  94.     Endif
  95.     If (Exist(STRING022 + "\INDEX-B")) Then
  96.         STRING023 = "B"
  97.         Gosub LABEL002
  98.     Endif
  99.     If (Exist(STRING022 + "\INDEX-C")) Then
  100.         STRING023 = "C"
  101.         Gosub LABEL002
  102.     Endif
  103.     If (Exist(STRING022 + "\INDEX-D")) Then
  104.         STRING023 = "D"
  105.         Gosub LABEL002
  106.     Endif
  107.     If (Exist(STRING022 + "\INDEX-E")) Then
  108.         STRING023 = "E"
  109.         Gosub LABEL002
  110.     Endif
  111.     If (Exist(STRING022 + "\INDEX-F")) Then
  112.         STRING023 = "F"
  113.         Gosub LABEL002
  114.     Endif
  115.     If (Exist(STRING022 + "\INDEX-G")) Then
  116.         STRING023 = "G"
  117.         Gosub LABEL002
  118.     Endif
  119.     If (Exist(STRING022 + "\INDEX-H")) Then
  120.         STRING023 = "H"
  121.         Gosub LABEL002
  122.     Endif
  123.     If (Exist(STRING022 + "\INDEX-I")) Then
  124.         STRING023 = "I"
  125.         Gosub LABEL002
  126.     Endif
  127.     If (Exist(STRING022 + "\INDEX-J")) Then
  128.         STRING023 = "J"
  129.         Gosub LABEL002
  130.     Endif
  131.     If (Exist(STRING022 + "\INDEX-K")) Then
  132.         STRING023 = "K"
  133.         Gosub LABEL002
  134.     Endif
  135.     If (Exist(STRING022 + "\INDEX-L")) Then
  136.         STRING023 = "L"
  137.         Gosub LABEL002
  138.     Endif
  139.     If (Exist(STRING022 + "\INDEX-M")) Then
  140.         STRING023 = "M"
  141.         Gosub LABEL002
  142.     Endif
  143.     If (Exist(STRING022 + "\INDEX-N")) Then
  144.         STRING023 = "N"
  145.         Gosub LABEL002
  146.     Endif
  147.     If (Exist(STRING022 + "\INDEX-O")) Then
  148.         STRING023 = "O"
  149.         Gosub LABEL002
  150.     Endif
  151.     If (Exist(STRING022 + "\INDEX-P")) Then
  152.         STRING023 = "P"
  153.         Gosub LABEL002
  154.     Endif
  155.     If (Exist(STRING022 + "\INDEX-Q")) Then
  156.         STRING023 = "Q"
  157.         Gosub LABEL002
  158.     Endif
  159.     If (Exist(STRING022 + "\INDEX-R")) Then
  160.         STRING023 = "R"
  161.         Gosub LABEL002
  162.     Endif
  163.     If (Exist(STRING022 + "\INDEX-S")) Then
  164.         STRING023 = "S"
  165.         Gosub LABEL002
  166.     Endif
  167.     If (Exist(STRING022 + "\INDEX-T")) Then
  168.         STRING023 = "T"
  169.         Gosub LABEL002
  170.     Endif
  171.     If (Exist(STRING022 + "\INDEX-U")) Then
  172.         STRING023 = "U"
  173.         Gosub LABEL002
  174.     Endif
  175.     If (Exist(STRING022 + "\INDEX-V")) Then
  176.         STRING023 = "V"
  177.         Gosub LABEL002
  178.     Endif
  179.     If (Exist(STRING022 + "\INDEX-W")) Then
  180.         STRING023 = "W"
  181.         Gosub LABEL002
  182.     Endif
  183.     If (Exist(STRING022 + "\INDEX-X")) Then
  184.         STRING023 = "X"
  185.         Gosub LABEL002
  186.     Endif
  187.     If (Exist(STRING022 + "\INDEX-Y")) Then
  188.         STRING023 = "Y"
  189.         Gosub LABEL002
  190.     Endif
  191.     If (Exist(STRING022 + "\INDEX-Z")) Then
  192.         STRING023 = "Z"
  193.         Gosub LABEL002
  194.     Endif
  195.     :LABEL002
  196.     Backup 1
  197.     Print "@X0C" + STRING023
  198.     FOpen 1, STRING022 + "\Index-" + STRING023, 0, 3
  199.     FOpen 2, STRING026 + "\Index-" + STRING023 + ".NEW", 1, 0
  200.     :LABEL003
  201.     FGet 1, STRING001
  202.     If (Left(STRING001, 16) == "Version 2.0 Data") Then
  203.         Goto LABEL006
  204.         End
  205.     ElseIf (Left(STRING001, 10) == "Dummy Name") Then
  206.         FGet 1, STRING002
  207.         FGet 1, STRING003
  208.         BIGSTR001 = "Version 2.0 Data"
  209.         Goto LABEL004
  210.         End
  211.     ElseIf (STRING001 == "") Then
  212.         If (STRING002 == "") Then
  213.             Newline
  214.             PrintLn "The conversion ended on this Index as if it had come to the end of the file"
  215.             PrintLn "but there is still data continuing. Check the Index file for a blank line where"
  216.             PrintLn "there shouldn't be one. And start the conversion over."
  217.             Newline
  218.             FClose 1
  219.             FClose 2
  220.             Delete STRING026 + "\Index-" + STRING023 + ".NEW"
  221.             End
  222.         Endif
  223.         If ((STRING023 == "Z") || (STRING023 == "")) Then
  224.             FClose 1
  225.             FClose 2
  226.             Copy STRING022 + "\Index-Z", STRING026 + "\Index-Z.OLD"
  227.             Delete STRING022 + "\Index-Z"
  228.             Copy STRING026 + "\Index-Z.NEW", STRING026 + "\Index-Z"
  229.             Delete STRING026 + "\Index-Z.NEW"
  230.             Goto LABEL007
  231.             End
  232.         Else
  233.             FClose 1
  234.             FClose 2
  235.             Copy STRING022 + "\Index-" + STRING023, STRING026 + "\Index-" + STRING023 + ".OLD"
  236.             Delete STRING022 + "\Index-" + STRING023
  237.             Copy STRING026 + "\Index-" + STRING023 + ".NEW", STRING026 + "\Index-" + STRING023
  238.             Delete STRING026 + "\Index-" + STRING023 + ".NEW"
  239.             STRING023 = ""
  240.             Return
  241.         Endif
  242.     Else
  243.         If (Left(STRING001, 1) == ";") Then
  244.             Newline
  245.             PrintLn "@X0DE@X0Arror in @X0DI@X0Andex-@X0C" + STRING023 + " @X0DD@X0Aata file. @X0DR@X0Aepairing and @X0DP@X0Aroceeding."
  246.             Print "@X0DC@X0Aonverting @X0BIndex-@X0C" + STRING023
  247.             Goto LABEL003
  248.         Else
  249.             FGet 1, STRING002
  250.             FGet 1, STRING003
  251.             Gosub LABEL005
  252.             :LABEL004
  253.             FPutLn 2, BIGSTR001
  254.             Goto LABEL003
  255.         Endif
  256.     Endif
  257.     :LABEL005
  258.     STRING021 = Left(STRING001, 25)
  259.     STRING004 = Right(Left(STRING001, 27), 1)
  260.     STRING005 = Right(Left(STRING001, 30), 2)
  261.     STRING006 = Right(Left(STRING001, 56), 25)
  262.     STRING007 = Right(Left(STRING001, 82), 25)
  263.     STRING008 = Right(Left(STRING001, 95), 12)
  264.     STRING009 = Right(Left(STRING001, 151), 55)
  265.     STRING010 = Right(Left(STRING001, 164), 12)
  266.     STRING011 = Right(Left(STRING001, 191), 26)
  267.     STRING012 = Right(Left(STRING001, 217), 25)
  268.     STRING013 = Right(Left(STRING001, 243), 25)
  269.     STRING014 = Right(Left(STRING002, 21), 20)
  270.     STRING015 = Right(Left(STRING002, 47), 20)
  271.     STRING016 = Right(Left(STRING002, 79), 30)
  272.     STRING017 = Right(Left(STRING002, 106), 25)
  273.     STRING018 = Right(Left(STRING002, 173), 65)
  274.     STRING019 = Right(Left(STRING002, 245), 70)
  275.     STRING020 = Right(STRING003, 132)
  276.     BIGSTR001 = STRING021 + ";" + STRING004 + ";" + Left(STRING005, 3) + ";" + Left(STRING006, 25) + ";" + Left(STRING007, 25) + ";" + Left(STRING008, 12) + ";" + Left(STRING009, 54) + ";" + Left(STRING010, 12) + ";" + Left(STRING011, 26) + ";" + Left(STRING012, 25) + ";" + Left(STRING013, 25) + ";" + Left(STRING014, 35) + ";" + Left(STRING015, 20) + ";" + Left(STRING016, 35) + ";" + Left(STRING017, 35) + ";" + Left(STRING018, 55) + ";" + Left(STRING019, 55) + ";" + Left("", 35) + ";" + Left("", 50) + ";" + Left("", 8) + ";" + Left(STRING020, 65) + ";" + Left("", 50) + ";"
  277.     Return
  278.     :LABEL006
  279.     Newline
  280.     PrintLn "@X0AThis data has already been converted to 2.0 Data."
  281.     End
  282.     :LABEL007
  283.     Copy STRING022 + "\List.dat", STRING026 + "\List.dat"
  284.     Delete STRING022 + "List.dat"
  285.     Newlines 2
  286.     PrintLn "@X0AYour data has been converted and your old data has been stored with"
  287.     PrintLn "@X0Aa '.OLD' extention."
  288.     End
  289.     :LABEL008
  290.     Newline
  291.     PrintLn "You do not currently have a REGISTERED version. This Data cannot be"
  292.     PrintLn "converted until you REGISTER this PPE or you may restart your Data"
  293.     PrintLn "by deleteing the Index files."
  294.     End
  295.  
  296. ;------------------------------------------------------------------------------
  297. ;
  298. ; Usage report (before postprocessing)
  299. ;
  300. ; ■ Statements used :
  301. ;
  302. ;    9       End
  303. ;    52      Goto 
  304. ;    54      Let 
  305. ;    3       Print 
  306. ;    16      PrintLn 
  307. ;    37      If 
  308. ;    3       FOpen 
  309. ;    7       FClose 
  310. ;    8       FGet 
  311. ;    1       FPutLn 
  312. ;    6       Delete 
  313. ;    1       InputStr 
  314. ;    27      Gosub 
  315. ;    2       Return
  316. ;    8       Newline
  317. ;    1       Newlines 
  318. ;    1       Backup 
  319. ;    5       Copy 
  320. ;
  321. ;
  322. ; ■ Functions used :
  323. ;
  324. ;    2       *
  325. ;    111     +
  326. ;    9       ==
  327. ;    1       <
  328. ;    1       <=
  329. ;    2       >=
  330. ;    37      !
  331. ;    2       &&
  332. ;    2       ||
  333. ;    1       Len(
  334. ;    1       Mid()
  335. ;    40      Left()
  336. ;    17      Right()
  337. ;    1       Ferr()
  338. ;    1       Asc()
  339. ;    1       Strip()
  340. ;    1       Mask_Ascii()
  341. ;    2       PPEPath()
  342. ;    27      Exist()
  343. ;
  344. ;------------------------------------------------------------------------------
  345. ;
  346. ; Analysis flags : No flag
  347. ;
  348. ;------------------------------------------------------------------------------
  349. ;
  350. ; Postprocessing report
  351. ;
  352. ;    1       For/Next
  353. ;    0       While/EndWhile
  354. ;    36      If/Then or If/Then/Else
  355. ;    0       Select Case
  356. ;
  357. ;------------------------------------------------------------------------------
  358. ;                 AEGiS Corp - Break the routines, code against the machines!
  359. ;------------------------------------------------------------------------------
  360.